gusucode.com > 现代通信系统——使用MATLAB(+全部程序) > 现代通信系统——使用MATLAB(+全部程序)/现代通信系统——使用MATLAB(+全部程序)/Matlab 程序/Chapter3/am_mod.m

    function u=am_mod(a,m,ts,fc)
%       u=am_mod(a,m,ts,fc)
%AM_MOD     takes signal m sampled at ts and carrier
%       freq. fc as input and returns the AM modulated
%       signal. "a" is the modulation index
%       and ts << 1/2fc. 

t=[0:length(m)-1]*ts;
c=cos(2*pi*fc.*t);                 
m_n=m/max(abs(m)); 
u=(1+a*m_n).*c;